#pragma once

#include "AbstractLock.h"

class Lock_ICDLL : public AbstractLock
{
public:
	Lock_ICDLL();
	~Lock_ICDLL();
	
	bool isVaild();

	virtual Json::Value DealCommand(QString cmd,Json::Value &param);
	bool checkParam(QString cmd,Json::Value &param,QString &error);
	QString errorMessage(int r);
	int strToTimestamp(QString str);
	QString timestampToStr(int timestamp);

	int GetDLLInfo(char *info);
	bool Init(int SoftType,const char *softPath);
	int OpenPort();
	int ClosePort();
	int ReadCard(char *CRoom_no,char *cOwner,char *cOperator,char *cardbgndate,char *cardenddate,char *cNum);
	int IssueCard(const char *CDate,const char *CGuest,const char *COperator,int TLoss,const char *pchar,const char *CEndDate);
	bool CancelCard(const char *coperator);
	void Beep_();
	
	bool openFlag;
};